define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
	
	var Model = function(){
		this.callParent();
	};

	Model.prototype.editBtnClick = function(event){
		var note = this.comp('notesData');
		justep.Shell.showPage('edit', {
			data: {
				id: note.val('id'),
				title: note.val('title'),
				detail: note.val('detail'),
				created: note.val('created'),
				modified: note.val('modified')
			}
		});
	};

	Model.prototype.modelParamsReceive = function(event){
		if (event.params.data) {
			var notesData = this.comp("notesData");
			notesData.clear();
			notesData.newData({
				defaultValues:[
				     event.params.data
			]});
		}
	};

	return Model;
});